﻿
using ChargingSystem4.CsForm;
using LawEnforcementInstrument.FrmBase;
using Oliving.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LawEnforcementInstrument.FrmBase//winSystem.FBase
{
    public partial class FrmSplash : Form, ISplashForm
    {
        public FrmSplash()
        {
            InitializeComponent();

            //   this.TopMost = true;

        }


        #region ISplashForm 成员


        public void SetTitleInfo(string NewStatusInfo)
        {
            label1.Text = NewStatusInfo;
        }

        public void SetStatusInfo(string NewStatusInfo)
        {
            lblStatusInfo.Text = NewStatusInfo;
        }

        public void SetProBarValue(int value)
        {
            throw new NotImplementedException();
        }

        public void SetProBarMaxValue(int value)
        {
            throw new NotImplementedException();
        }

        public void SetProBarStyle(string flag)
        {

        }

        #endregion
        int i = 1;
        private void timer1_Tick(object sender, EventArgs e)
        {
            i = i + 1;
            progressBar1.Value = i * 10;
            if (i == 10)
            {
                i = 1;
            }
        }

        private void FrmSplash_Load(object sender, EventArgs e)
        {

            //Program.startListen();

            //if (ConfigHelper.GetValueToInt("IsTest") != 1)
            //{
            //    FormHelper.InitView(this); 
            //    int pointX = (this.Width - panelMain.Width) / 2;
            //    int pointY = (this.Height - panelMain.Height) / 2; 
            //    panelMain.Location = new Point(pointX, pointY);
            //}
        }

        private void panel1_DoubleClick(object sender, EventArgs e)
        {

            dtColse = DateTime.Now;
        }

        private void panel2_DoubleClick(object sender, EventArgs e)
        {
            TimeSpan ts = DateTime.Now - dtColse;
            if (ts.Milliseconds <= (30 * 1000))
            {
                // System.Windows.Forms.Application.Exit();
                this.Close();
            }
        }

        public DateTime dtColse = DateTime.MinValue;


    }
}
